﻿<UserControl x:Class="OpenTKLightingTool.Controls.LightProperties"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ctrl="clr-namespace:OpenTKLightingTool.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="360" d:DesignWidth="370">
    <Grid>
        <StackPanel Orientation="Vertical">
            <GroupBox Header="Position / Direction">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Label>Position:</Label>
                    <ctrl:Vector4Control x:Name="uxPosition" Grid.Column="1" MinValue="-100" MaxValue="100" />
                </Grid>               
            </GroupBox>
            
            <GroupBox Header="Light Colors">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <Label Grid.Row="0">Ambient:</Label>
                    <ctrl:Vector4Control x:Name="uxAmbient" Grid.Column="1" Grid.Row="0" IsColor="True" />
                    <Label Grid.Row="1">Diffuse:</Label>
                    <ctrl:Vector4Control x:Name="uxDiffuse" Grid.Column="1" Grid.Row="1" IsColor="True" />
                    <Label Grid.Row="2">Specular:</Label>
                    <ctrl:Vector4Control x:Name="uxSpecular" Grid.Column="1" Grid.Row="2" IsColor="True" />
                </Grid>
            </GroupBox>
            
            <GroupBox Header="Attenuation">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    
                    <Label Grid.Row="0">Constant:</Label>
                    <ctrl:FloatTextBox x:Name="uxConstantAttenuation" Grid.Row="0" Grid.Column="1" Margin="2" MinValue="0" MaxValue="10000" />
                    <Label Grid.Row="1">Linear:</Label>
                    <ctrl:FloatTextBox x:Name="uxLinearAttenuation" Grid.Row="1" Grid.Column="1" Margin="2" MinValue="0" MaxValue="10000"/>
                    <Label Grid.Row="2">Quadratic:</Label>
                    <ctrl:FloatTextBox x:Name="uxQuadraticAttenuation" Grid.Row="2" Grid.Column="1" Margin="2" MinValue="0" MaxValue="10000"/>
                </Grid>
            </GroupBox>
            
            <GroupBox Header="Spot Light">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <Label Grid.Row="0">Spot cutoff:</Label>
                    <ctrl:FloatTextBox x:Name="uxSpotCutOff" Grid.Row="0" Grid.Column="1" Margin="2" MinValue="0" MaxValue="180" />
                    
                    <Label Grid.Row="1">Spot direction:</Label>
                    <ctrl:Vector4Control x:Name="uxSpotDirection" Grid.Column="1" Grid.Row="1"  MinValue="-100" MaxValue="100" />

                    <Label Grid.Row="2">Spot exponent:</Label>
                    <ctrl:FloatTextBox x:Name="uxSpotExponent" Grid.Row="2" Grid.Column="1" Margin="2" />
                </Grid>
            </GroupBox>
        </StackPanel>
    </Grid>
</UserControl>
